//
//  HLAboutFooterView.m
//  YueYue
//
//  Created by hulu001 on 2023/8/12.
//

#import "HLAboutFooterView.h"

@implementation HLAboutFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
        
    }
    return self;
}


- (void)setupView
{
    self.titleLabel = [[UILabel alloc] qmui_initWithFont:UIFontMake(13) textColor:HLTextColor1];
    _titleLabel.text = @"合作邮箱";
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.mas_equalTo(0);
    }];
    
    self.emailButton = [[QMUIButton alloc] init];
    [_emailButton setTitle:@"xzkehao@163.com" forState:UIControlStateNormal];
    [_emailButton setTitleColor:HLMainColor forState:UIControlStateNormal];
    [_emailButton.titleLabel setFont:UIFontMake(13)];
    [_emailButton addTarget:self action:@selector(copyMail) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_emailButton];
    [_emailButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLabel.mas_right).offset(4);
        make.right.mas_equalTo(0);
    }];
}

- (void)copyMail
{
    [[UIPasteboard generalPasteboard] setString:@"xzkehao@163.com"];
    [QMUITips showWithText:@"已经复制邮箱地址"];
}
@end
